$(function() {
    $(window).scroll(function() {
        if ($(this).scrollTop() != 0) {
            $("#toTop").fadeIn()
        } else {
            $("#toTop").fadeOut()
        }
    });
    $("#toTop").click(function() {
        $("body,html").animate({scrollTop: 0}, 3500)
    })
});
$(document).ready(function() {
    $("[rel=tooltip]").tooltip()
});
$(document).ready(function() {
    var e = $("#slider").leanSlider({directionNav: "#slider-direction-nav", controlNav: "#slider-control-nav"})
});
$(document).ready(function() {
    var e = {Android: function() {
            return navigator.userAgent.match(/Android/i)
        }, BlackBerry: function() {
            return navigator.userAgent.match(/BlackBerry/i)
        }, iOS: function() {
            return navigator.userAgent.match(/iPhone|iPad|iPod/i)
        }, Opera: function() {
            return navigator.userAgent.match(/Opera Mini/i)
        }, Windows: function() {
            return navigator.userAgent.match(/IEMobile/i)
        }, any: function() {
            return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows()
        }};
    var t = e.any();
    if (t == null) {
        $("#intro").parallax("50%", .1);
        $("#second").parallax("50%", .1);
        $("#third").parallax("50%", .1);
        $("#fourth").parallax("50%", .1);
        $("#fifth").parallax("50%", .4)
    }
});
$(document).ready(function() {
    function n(e, t) {
        var n = $("<ul>", {"class": "hidden"});
        $.each(t, function() {
            $(this).clone().appendTo(n)
        });
        n.appendTo("#container");
        var r = $("<a>", {html: e, href: "#", data: {list: n}}).appendTo("#filter")
    }
    var e = $("#stage li"), t = {};
    e.each(function(e) {
        var n = $(this), r = n.data("tags").split(",");
        n.attr("data-id", e);
        $.each(r, function(e, r) {
            r = $.trim(r);
            if (!(r in t)) {
                t[r] = []
            }
            t[r].push(n)
        })
    });
    n("Show All", e);
    $.each(t, function(e, t) {
        n(e, t)
    });
    $("#filter a").live("click", function(e) {
        var t = $(this);
        t.addClass("active").siblings().removeClass("active");
        $("#stage").quicksand(t.data("list").find("li"));
        e.preventDefault()
    });
    $("#filter a:first").click()
});
$(document).ready(function() {
    $("#registerHere input").hover(function() {
        $(this).popover("show")
    });
    $("#registerHere").validate({rules: {user_name: "required", user_email: {required: true, email: true}, pwd: {required: true, minlength: 30}, cpwd: {required: false, equalTo: "#pwd"}, gender: "required"}, messages: {user_name: "Enter your first and last name", user_email: {required: "Enter your email address", email: "Enter valid email address"}, pwd: {required: "Enter your Your Subject", minlength: "Your Subject must be minimum 30 characters"}, cpwd: {required: "Send Message", equalTo: "Type Your Message"}, gender: "Select Gender"}, errorClass: "help-inline", errorElement: "span", highlight: function(e, t, n) {
            $(e).parents(".control-group").addClass("error")
        }, unhighlight: function(e, t, n) {
            $(e).parents(".control-group").removeClass("error");
            $(e).parents(".control-group").addClass("success")
        }})
});
$(document).ready(function() {
    $(".nav a").click(function() {
        $("html, body").animate({scrollTop: $($(this).attr("href")).offset().top + "px"}, {duration: 1500, easing: "easeInOutQuint"});
        return false
    })
});
$('[data-spy="scroll"]').each(function() {
    var e = $(this).scrollspy("refresh")
})

